#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m;
int a[N];
char oth(char c) {
  if (c == 'i')
    return 'o';
  else
    return 'i';
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  string s;
  cin >> s;
  int ans = 0;
  vector<char> a;
  a.push_back('o');
  for (char c : s) {
    if (c == a.back()) a.push_back(oth(c));
    a.push_back(c);
  }
  if (a.back() != 'o') a.push_back('o');
  cout << a.size() - s.size() - 1;
  return 0;
}